﻿/**
* Copyright (c) 2008 Glanceguide, Inc.  All rights reserved. 
* http://www.glanceguide.com
* Decompiling, reverse engineering, copying or unauthorized redistribution is prohibited.    
*
* ggSoundTransform class is a wrapper class for SoundTransform (AC3)
* Intercepts the Sound change events and records important metrics before returning control back to SoundTransform.
*
**/

package com.nielsen
{
	import flash.media.SoundTransform;
	
	public class ggSoundTransform 
	{
		private var _soundTransform:SoundTransform;
		
		// Constructor 	
		public function ggSoundTransform( vol:Number = 1, panning:Number = 0 ) 
		{
			// Create SoundTransform
			_soundTransform = new SoundTransform( vol, panning );
		}
		
		// Return the SoundTransfomr
		public function getSoundTransform( )
		{
			return _soundTransform;
		}

		// Volume getters and setters
		public function set volume( value:Number ) : void 
		{
			// Send sound event to GlanceGuide	
			ggCom.getInstance( ).PM( 11, value * 100 );
			
			// Set sound in SoundTransform
			_soundTransform.volume = value;
		}
		
		public function get volume( ) : Number 
		{
			return _soundTransform.volume;
		}
	
		// Remaining necessary wrapper methods
		public function set leftToLeft( value:Number ) : void 
		{
			_soundTransform.leftToLeft = value;
		}
		
		public function get leftToLeft( ) : Number 
		{
			return _soundTransform.leftToLeft;
		}

		public function set leftToRight( value:Number ) : void 
		{
			_soundTransform.leftToRight = value;
		}
		
	    public function get leftToRight( ) : Number 
		{
			return _soundTransform.leftToRight;
		}
		
		public function set pan( value:Number ) : void 
		{
			_soundTransform.pan = value;
		}
		
	    public function get pan( ) : Number 
		{
			return _soundTransform.pan;
		}

		public function set rightToLeft( value:Number ) : void 
		{
			_soundTransform.rightToLeft = value;
		}
			
	    public function get rightToLeft( ) : Number 
		{
			return _soundTransform.rightToLeft;
		}

    	public function set rightToRight( value:Number ) : void 
		{
			_soundTransform.rightToRight = value;
		}
		
	    public function get rightToRight( ) : Number 	
		{
			return _soundTransform.rightToRight;
		}
	}
}